﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tools;

namespace EntityModel
{
    /// <summary>
    /// 宿舍表
    /// </summary>
    [Table("D2")]
    public class EM_Hostel:EntityBase
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public EM_Hostel()
        {
            this.ConstructionTime = DateTime.Now;
        }
        /// <summary>
        /// 宿舍楼名称
        /// </summary>
        [Column("D001")]
        [StringLength(50)]
        [Required]
        public string? BuildingName { get; set; }

        /// <summary>
        /// 宿舍楼地址
        /// </summary>
        [Column("D002")]
        [StringLength(50)]
        [Required]
        public string? Address { get; set; }

        /// <summary>
        /// 宿舍楼建造时间
        /// </summary>
        [Column("D003")]
        [Required]
        public DateTime ConstructionTime { get; set; }

        /// <summary>
        /// 宿舍寝室
        /// 单人寝室：0
        /// 双人寝室：1
        /// 四人寝室：2
        /// </summary>
        [Column("D004")]
        [Required]
        public DormitoryRoom DormitoryRoom { get; set; }

        /// <summary>
        /// 宿舍内家具
        /// </summary>
        [Column("D005")]
        [StringLength(50)]
        [Required]
        public string? Furniture { get; set; }

        /// <summary>
        /// 宿舍阳台
        /// </summary>
        [Column("D006")]
        [Required]
        public bool Balcony { get; set; }

        /// <summary>
        /// 宿舍独立淋浴间
        /// </summary>
        [Column("D007")]
        [Required]
        public bool ShowerRoom { get; set; }

        /// <summary>
        /// 宿舍厕所
        /// </summary>
        [Column("D008")]
        [Required]
        public bool Toilet { get; set; }

        /// <summary>
        /// 宿舍负责人
        /// </summary>
        [Column("D009")]
        [StringLength(50)]
        [Required]
        public string? Supervisor { get; set; }

        /// <summary>
        /// 宿舍人员信息
        /// </summary>
        [Required]
        public required EM_Students EM_Student { get; set; }
    }
}
